{extend name="base/common"}

{block name="style"}
<link href="/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
<!-- Sweet Alert -->
<link href="/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
{/block}


{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>备份还原</h2>
        <ol class="breadcrumb">
            <li>
                <a href="index.html">Database</a>
            </li>
            <li class="active">
                <strong>import</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>备份列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#">Config option 1</a>
                            </li>
                            <li><a href="#">Config option 2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th><input class="i-checks check-all" type="checkbox"></th>
                                <th width="200">备份名称</th>
                                <th width="80">卷数</th>
                                <th width="80">压缩</th>
                                <th width="80">数据大小</th>
                                <th width="200">备份时间</th>
                                <th>状态</th>
                                <th width="120">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="data"}
                                <tr>
                                    <td class="num">
                                        <input class="i-checks ids" type="checkbox" name="times[]" value="$data['time']">
                                    </td>
                                    <td>{$data.time|date='Ymd-His',###}</td>
                                    <td>{$data.part}</td>
                                    <td>{$data.compress}</td>
                                    <td>{$data.size|format_bytes}</td>
                                    <td>{$key}</td>
                                    <td>-</td>
                                    <td class="action">
                                        <a class="db-import" href="{:Url('import?time='.$data['time'])}">还原</a>&nbsp;
                                        <a class="ajax-get confirm" href="{:Url('del?time='.$data['time'])}">删除</a>
                                    </td>
                                </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<!-- Peity -->
<script src="/admin/js/demo/peity-demo.js"></script>
<script src="/admin/js/plugins/peity/jquery.peity.min.js"></script>
<!-- iCheck -->
<script src="/admin/js/plugins/iCheck/icheck.min.js"></script>

<!-- Sweet alert -->
<script src="/admin/js/plugins/sweetalert/sweetalert.min.js"></script>
<script>
$(function(){
    highlight_subnav("{:Url('Database/import')}");
    $('.i-checks').iCheck({
        checkboxClass: 'icheckbox_square-green',
        radioClass: 'iradio_square-green',
    });
    $(".check-all").on("ifChanged",function(){
        $("tbody").find(".ids").iCheck("toggle");
    });

    $("#action_add").click(function(){
        window.location.href = $(this).attr('url');
    })
});
</script>
{/block}